<%--
  Created by IntelliJ IDEA.
  User: 86176
  Date: 2024/8/23
  Time: 10:02
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>

<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<c:set value="${pageContext.request.contextPath}" var="path"> </c:set>
<link rel="stylesheet" type="text/css" href="${path}/static/manage/css/MsgStyle.css"/>
<script src="${path}/static/manage/js/jquery-3.6.0.min.js"></script>
<script src="${path}/static/manage/js/showParking.js"></script>

<html>
<head>
    <title>Title</title>


        <script>
            $(function () {
                $(".password").click(ResetPassword);
            });
            function ResetPassword()
            {

                var userphone=$(this).attr("onclick");
                var id=$(this).attr("id");
                var newpassword=userphone.substring(5,12);


                $.ajax({
                    url:"/project/manage/resetpassword",
                    data:{x:id, y:newpassword},
                    type:"get",
                    success:function (mes) {
                        alert("重置成功")
                    }
                })
            }
        </script>
    </head>
<body>
<div class="div_container">
    <div class="searchDiv">
        <span>查询条件:</span>
    <form action="${path}/manage/findUserByCondition">
    <select name="select">
        <option value="用户名称">用户名称</option>
        <option value="用户电话">用户电话</option>
    </select>
        <span>查询值:</span>
    <input  type="text" name="test">
    <input type="submit" value="查询">
    </form>
</div>
<table id="pageListTable" border="1"  style=" margin:50px auto;">
   <thead>
   <tr>
       <th>用户名称</th>
       <th>用户电话</th>
       <th>头像</th>
       <th>楼牌号</th>
       <th>余额</th>
       <th>操作</th>
   </tr>
   </thead>
    <tbody id="pageListTableBody">
    <c:forEach items="${userList}" var="user">
        <tr>
            <td>${user.userName}</td>
            <td>${user.userPhone}</td>
            <td><img src="${path}/static/uploadimages/${user.userFace}"width="50"></td>
            <td>${user.houseNumber}</td>
            <td>${user.totalMoney}</td>
            <td><input type="button" value="重置密码" id="${user.id}" onclick="${user.userPhone}" class="password"></td>
        </tr>
    </c:forEach>
    </tbody>
    <tfoot>
    <tr><td colspan="6">
        <div id="pages" style="float: right;margin-right: 20px;">
            <span id="spanFirst">首页</span>
            <span id="spanPre">上一页</span>
            <span id="spanNext">下一页</span>
            <span id="spanLast">尾页</span>
            第<strong id="spanPageNum"></strong>页/共
            <strong id="spanTotalPage"></strong>页
        </div>
    </td>
    </tr>
    </tfoot>
</table>
</div>
</body>
</html>
